<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* css属性选择器  */
    [v-cloak]{ 
      display: none;
    }
  </style>
</head>
<body>
  <div id="app">
    1. v-pre 展示源代码的  <hr>
    <p> {{ msg }} </p>
    <p v-pre> {{ msg }} </p>
    2. v-once 数据只渲染一次 <hr> 
    <button @click="add" v-once> + {{n}} </button>  <br>

    3. v-cloak 来解决代码闪现问题 <hr>
    <p v-cloak> {{ msg }} </p>

  </div>
</body>
<script src="../../lib/vue.global.js"></script>
<script>
  Vue.createApp({
    data () {
      return {
        msg: 'Hello Vue3',
        n: 1
      }
    },
    methods: {
      add () {
        this.n++
      }
    }
  }).mount('#app')
</script>
</html>